using System.Windows;
using Microsoft.Practices.CompositeUI;

namespace UIAdapters
{
	public sealed class RootWorkItem : WorkItem
	{
		protected override void OnRunStarted()
		{
			base.OnRunStarted();

			MainWindow mainWindow = Items.AddNew<MainWindow>();
			Application.Current.MainWindow = mainWindow;
			Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
			mainWindow.Show();
		}
	}
}
